package com.jake.groovy.ex1;

import groovy.lang.GroovyClassLoader;

import java.io.File;

public class GoovyLoader {

	public GoovyLoader(){
		
	}
	public void printGroovy(){
		String fileName = "./src/com/jake/groovy/ex1/Tester.groovy";
		GroovyClassLoader gcl = new GroovyClassLoader();
		try{
		
			Class clazz = gcl.parseClass(new File(fileName));
			Object aScript = clazz.newInstance();
	
			TestInterface ifc = (TestInterface) aScript;
			ifc.print();
				
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
